package com.feng.service;

import com.feng.mapper.BooksMapper;
import com.feng.pojo.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

public class BookServiceImpl implements BookService {

    private BooksMapper booksMapper;



    public void setBooksMapper(BooksMapper booksMapper) {
        this.booksMapper = booksMapper;
    }

    @Override
    public int addBook(Book book) {
       return booksMapper.addBook(book);
    }

    @Override
    public int deleteBook(int id) {
        return booksMapper.deleteBook(id);
    }

    @Override
    public int updateBook(Book book) {
        return booksMapper.updateBook(book);
    }

    @Override
    public List<Book> queryBooks() {
        System.out.println("----------------------------------------");
        return booksMapper.queryBooks();
    }

    @Override
    public List<Book> queryBooksByName(String bookName) {
        return booksMapper.queryBooksByName(bookName);
    }

    @Override
    public Book quaryBookById(int id) {
        return booksMapper.quaryBookById(id);
    }
}
